package by.msokoloff.javaweb2015.datamodel;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "city")
public class City extends AbstractEntity {

	@ManyToOne
	private Country country;

	@Column
	private String name;

	public Country getCountry() {
		return country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "[City: " + this.name + "; Country: " + this.country.getName() + "]";
	}
}
